package com.aiti.lulian.controller;

import cn.hutool.core.util.StrUtil;
import com.aiti.base.core.base.controller.WebController;
import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.dto.CardGovBannerDto;
import com.aiti.lulian.dto.CardQuotationDto;
import com.aiti.lulian.entity.CardGovBannerEntity;
import com.aiti.lulian.entity.CardQuotation;
import com.aiti.lulian.entity.LuLianEnterpriseHistory;
import com.aiti.lulian.entity.LuLianEnterpriseUser;
import com.aiti.lulian.service.CardGovBannerService;
import com.aiti.lulian.vo.CardQuotationVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 政府banner图 前端控制器
 * </p>
 *
 * @author 
 * @since 2025-03-04
 */
@RestController
@RequestMapping("/banner")
public class CardGovBannerController extends WebController {

    @Autowired
    private CardGovBannerService cardGovBannerService;

    @ApiOperation(value = "list")
    @GetMapping("list")
    public Message findQuotationListPage(CardGovBannerDto dto) {
        String govId = dto.getGovId();
        List<CardGovBannerEntity> list = new ArrayList();
        if(!StringUtils.isEmpty(govId)){
            list = cardGovBannerService.list(new LambdaQueryWrapper<CardGovBannerEntity>().eq(CardGovBannerEntity::getGovId, govId));
        }
        return Message.success(list);
    }

}
